﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>WordPaster For FCKEditor2.x,ExtJS</title>
    <link rel="stylesheet" type="text/css" href="extjs/resources/css/ext-all.css"/>
    <script type="text/javascript" src="extjs/adapter/ext/ext-base.js"></script>
    <script type="text/javascript" src="extjs/ext-all.js"></script>
	<script type="text/javascript" src="fckeditor/fckeditor.js"></script>
    <script type="text/javascript" src="WordPaster/json2.min.js" charset="utf-8"></script>
    <script type="text/javascript" src="WordPaster/jquery.min.js"></script>
    <script type="text/javascript" src="WordPaster/w.js" charset="utf-8"></script>
</head>
<body>
	<div style="font-size: medium; line-height: 130%;">
		<p>
			演示方法：</p>
		<ul style="list-style-type: decimal;">
			<li>打开Word文档，复制多张图片，然后点击工具栏中的"粘贴图片"按钮(在粘贴Word按钮的右边)，编辑器将自动上传所有图片。</li>
			<li>复制电脑中任意图片文件，然后点击编辑器中的图片粘贴按钮<img alt="粘贴图片" src="WordPaster/paster.png" width="16px" height="16px" />。</li>
			<li>通过QQ或其它软件截屏，复制图片，然后点击编辑器中的图片粘贴按钮<img alt="粘贴图片" src="WordPaster/paster.png" width="16px" height="16px" />。</li>
		</ul>
		<p>
			相关问题：</p>
		<ul style="list-style-type: decimal;">
			<li>如果无法识别数字证书，请先下载运行<a target="_blank" href="http://www.ncmem.com/download/rootsupd.rar">Windows证书补丁</a></li>
			<li>Windows7/Windows2003如果无法识别数字证书，请先下安装<a target="_blank" href="http://www.ncmem.com/download/startcom.cer">数字签名根证书</a></li>
			<li>如果无法安装组件请下载进行安装<a target="_blank" href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf%20">Microsoft Visual C++ 2008 Redistributable Package (x86)</a></li>
			<li>如果有任何问题或建议请向我们<a target="_blank" href="http://www.ncmem.com/blog/guestbook.asp">反馈</a></li>
		</ul>
	</div>    
	<!--创建FCKEditor控件-->
	<script language="javascript" type="text/javascript">
        //fix:IE9错误,对象不支持“createContextualFragment”属性或方法。
        if ((typeof Range !== "undefined") && !Range.prototype.createContextualFragment)
        {
            Range.prototype.createContextualFragment = function (html)
            {
                var frag = document.createDocumentFragment(),
				div = document.createElement("div");
                frag.appendChild(div);
                div.outerHTML = html;
                return frag;
            };
        }

        var pos = window.location.href.lastIndexOf("/");
        var api = [
            window.location.href.substr(0, pos + 1),
            "asp.net/upload.aspx"
        ].join("");
        WordPaster.getInstance({
            //上传接口：http://www.ncmem.com/doc/view.aspx?id=d88b60a2b0204af1ba62fa66288203ed
            PostUrl: api,
            //为图片地址增加域名：http://www.ncmem.com/doc/view.aspx?id=704cd302ebd346b486adf39cf4553936
            ImageUrl: "",
            //设置文件字段名称：http://www.ncmem.com/doc/view.aspx?id=c3ad06c2ae31454cb418ceb2b8da7c45
            FileFieldName: "file",
            //提取图片地址：http://www.ncmem.com/doc/view.aspx?id=07e3f323d22d4571ad213441ab8530d1
            ImageMatch: ''            
        });//加载控件

		var oFCKeditor = new FCKeditor('FCKeditor1');
		oFCKeditor.BasePath = "fckeditor/";
		//oFCKeditor.ToolbarSet = "Basic";
		oFCKeditor.Height = 300;
		oFCKeditor.Value = '';
		oFCKeditor.Create();

		//编辑器初始化完毕
		function FCKeditor_OnComplete(editorInstance)
		{
            WordPaster.getInstance().SetEditor(editorInstance);
		}
	</script>
</body>
</html>